//
//  FriendDetailViewController.m
//  IMDome
//
//  Created by 崔志伟 on 2020/8/23.
//  Copyright © 2020 czw. All rights reserved.
//

#import "FriendDetailViewController.h"

#import "FriendModel.h"

@interface FriendDetailViewController ()
@property (nonatomic,strong) FriendModel  * friendModel ;
@property (weak, nonatomic) IBOutlet UIImageView *headerIMgView;
@property (weak, nonatomic) IBOutlet UITextField *accountTextField;
@property (weak, nonatomic) IBOutlet UITextField *nameTextField;
@property (weak, nonatomic) IBOutlet UITextField *nickNameTextField;
@end

@implementation FriendDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"好友详情";
    [self laodData];
}

- (void)laodData{
    if (!kStringIsEmpty(self.friendId)) {
        NSMutableDictionary *params  = [NSMutableDictionary dictionary];
        [params setObject:[APPUserDataManager shareInstance].userId forKey:@"userId"];
        [params setObject:self.friendId forKey:@"friendId"];
        [BaseServiceManager getRequest:@"friend/getFriendInfo" params:params startBlock:^{
            [self showRequestHUDView];
        } successBlock:^(ResponseBaseModel * _Nonnull responseModel) {
            [self hideRequestHUDView];
            NSDictionary*dataDic = responseModel.data;
            self.friendModel= [FriendModel mj_objectWithKeyValues:dataDic];
            self.accountTextField.text = self.friendModel.friendAccount;
            self.nameTextField.text = self.friendModel.friendName;
            self.nickNameTextField.text = self.friendModel.friendNickName;
        } failureBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
            [self hideRequestHUDView];
        }];
    }
    
    
}
@end
